package hebClustering.vectorSpace;


/**
 *  This interface describes the basic operation required by a vector.
 *
 */
public interface IVector extends Iterable<Integer>{
	
	/**
	 * Get the i-th element of the vector.
	 * 
	 * @param i - The requested index.
	 * 
	 * @return The requested element.
	 */
	public double ithValue(int i);
	
	/**
	 * Get the dimension of the vector.
	 * 
	 * @return The dimension.
	 */
	public int getDimension();
	
	/**
	 * Add the element "value" to the index "pos" in the vector.
	 *  
	 * @param pos
	 * @param value
	 */
	public void addToVector(int pos,double value);
	
	/**
	 * Subtract the current vector and vec.
	 * 
	 * @param vec - A vector.
	 * 
	 * @return A vector that represent the difference between the two vectors.
	 */
	public IVector sub(IVector vec);
	
	/**
	 * Multiply the current vector and vec.
	 * 
	 * @param vec - A vector.
	 * 
	 * @return A vector that represent the product of the two vectors. 
	 */
	public double product(IVector vec);
	
	/**
	 * Checks if the current vector equals to vec.
	 * 
	 * @param vec - A vector.
	 * 
	 * @return true if the vectors are equal.
	 */
	public boolean equals(IVector vec);
	
}
